#lang racket


(require "../math.rkt"
         "../point.rkt")

(require "domain.rkt"
         "parametric-surface.rkt")


(provide make-plane)


(define-struct (plane parametric-surface)
  ()
  #:constructor-name new-plane)

(define (plane-object)
  (λ (u v) (xyz u v 0)))

(define (plane-tangent)
  (λ (u v) (list ux uy)))

(define (plane-normal)
  (λ (u v) uz))

(define (make-plane transformation)
  (new-plane
   (make-domain 'closed (- 2pi) 'closed 2pi)
   (make-domain 'closed (- 2pi) 'closed 2pi)
   (plane-object)
   (plane-tangent)
   (plane-normal)
   transformation))